package behavioral.responsibility;

/**
 * @Description: 部门主管
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class Director extends Handler{
    public Boolean check(String reason, int days) {
        if (days <= 4 && "年假".equals(reason)) {
            System.out.println(String.format("部门主管处理【%s】：同意！没玩爽别回来！", reason));
            return true;
        } else if ("禽流感需要隔离".equals(reason)) {
            System.out.println(String.format("部门主管处理【%s】：没问题，移交给研究院院长。", reason));
            return getNextHandler().check(reason, days);
        }
        System.out.println(String.format("部门主管处理【%s】：不同意，别乱请假", reason));
        return false;
    }
}
